import request from '@/utils/request'

// 获取用户按钮
export function getUserButtons(data) {
    return request({
        url: '/api/UserButtons/getUserButtonsList?scene=query',
        method: 'get',
        params: data
    })
}

// 获取全部按钮
export function getAllButtons(data) {
    return request({
        url: '/api/UserButtons/getList?scene=query',
        method: 'get',
        params: data
    })
}

// 获取用户tabs
export function getUserTabs(data) {
    return request({
        url: '/api/UserTabs/getUserTabsList?scene=query',
        method: 'get',
        params: data
    })
}

// 获取全部tabs
export function getAllTabs(data) {
    return request({
        url: '/api/UserTabs/getList?scene=query',
        method: 'get',
        params: data
    })
}

// 获取用户数据字段
export function getUserFields(data) {
    return request({
        url: '/api/UserFields/getUserFieldList?scene=wait',
        method: 'get',
        params: data
    })
}

// 获取全部数据字段
export function getAllFields(data) {
    return request({
        url: '/api/UserFields/getList?scene=wait',
        method: 'get',
        params: data
    })
}



// 创建任务
export function createTask(data) {
    return request({
        url: '/api/task/addTask',
        method: 'post',
        data: data
    })
}

// 获取任务进度
export function getTaskProgress(data) {
    return request({
        url: '/api/task/getTaskProgress',
        method: 'get',
        params: data
    })
}

// 打开、关闭某个按钮
export function switchBtnConfig(data) {
    return request({
        url: '/api/UserButtons/set',
        method: 'post',
        data: data
    })
}

// 打开、关闭某个tab
export function switchTabConfig(data) {
    return request({
        url: '/api/UserTabs/set',
        method: 'post',
        data: data
    })
}

// 打开、关闭某个字段
export function switchFieldConfig(data) {
    return request({
        url: '/api/UserQueryFields/set',
        method: 'post',
        data: data
    })
}

// 获取tabs统计结果
export function getTabStatistic(data) {
    return request({
        url: '/api/query/query',
        method: 'post',
        data: data
    })
}

//查询指定单子详情
export function getOrderDetail(data) {
    return request({
        url: '/api/Query/lookLogistic',
        method: 'get',
        params: data
    })
}

// 查询失效
export function queryTimelines(data) {
    return request({
        url: '/api/query/getShiXiao',
        method: 'post',
        data: data
    })
}

//创建查询任务
export function createQueryTask(data) {
    return request({
        url: '/api/task/addQueryTask',
        method: 'post',
        data: data
    })
}

//任务列表
export function getTaskList(data) {
    return request({
        url: '/api/task/getTaskList',
        method: 'get',
        params: data
    })
}

//重查任务
export function requeryTask(data) {
    return request({
        url: '/api/task/addRqTask',
        method: 'post',
        data: data
    })
}